#define _CRT_SECURE_NO_WARNINGS 1
#include"slist.h"
void test1()
{
	SLTNode* plist=NULL;
	SListPushBack(&plist, 1);
	SListPushBack(&plist, 2);
	SListPushBack(&plist, 3);
	SListPushBack(&plist, 4);

	SListPrint(plist);

	SListPopBack(&plist);
	SListPopBack(&plist);

	SListPrint(plist);
}
void test2()
{
	SLTNode* plist = NULL;
	SListPushBack(&plist, 1);
	SListPushBack(&plist, 2);
	SListPushBack(&plist, 3);
	SListPushBack(&plist, 4);

	SListPrint(plist);

	SListPushFront(&plist, 1);
	SListPushFront(&plist, 2);
	SListPushFront(&plist, 3);
	SListPushFront(&plist, 4);

	SListPrint(plist);


}

test3()
{
	SLTNode* plist = NULL;
	SListPushBack(&plist, 1);
	SListPushBack(&plist, 2);
	SListPushBack(&plist, 3);
	SListPushBack(&plist, 4);

	SListPrint(plist);

	SListPopFront(&plist);
	SListPopFront(&plist);
	SListPopFront(&plist);
	SListPopFront(&plist);

	SListPrint(plist);

}
void test4()
{
	SLTNode* plist = NULL;
	SListPushBack(&plist, 1);
	SListPushBack(&plist, 2);
	SListPushBack(&plist, 3);
	SListPushBack(&plist, 4);

	SListPrint(plist);

	SLTNode* pos = SListFind(&plist, 2);
	SListDel(&plist, pos);

	SListPrint(plist);

	pos = SListFind(&plist, 4);

	SListInsert(&plist, pos, 20);

	SListPrint(plist);

	SListInsertAfter(&plist, pos, 521);

	SListPrint(plist);

	SListDestory(&plist);

}
int main()
{

	//test1();
	//test2();
	//test3();
	test4();
	return 0;
}